<template>
  <div class="search-div-style">
    <MoreSearch :job_tag="job_tag" :job_info_data_in_search="job_info_data_in_search" :all_tags="all_tags"></MoreSearch>
  </div>
</template>

<script>
import MoreSearch from './MoreSearch'
import MoreSearchFoot from './MoreSearchFoot'

export default {
  name: 'index',
  components: {
    MoreSearch,
    MoreSearchFoot
  },
  data () {
    return {
      all_tags: [],
      job_tag: true,
      job_info_data_in_search: [],
    }
  },
  methods: {
    getRepeatNum () {
      return this.all_tags.reduce(function (prev, next) {
        prev[next] = (prev[next] + 1) || 1
        return prev
      }, {})
    }
  },
  created () {
    let _this = this
    setTimeout(function () {
      _this.all_tags = sessionStorage.getItem('all_taps').split('，')
      //console.log(_this.getRepeatNum())
      let temp = _this.getRepeatNum()
      _this.all_tags = []
      for (let key in temp) {
        // console.log(key)
        // console.log(temp[key])
        let temp3 = {
          'name': '',
          'style': true
        }
        temp3.name = key
        _this.all_tags.push(temp3)
      }
      //console.log(_this.all_tags)
      _this.job_info_data_in_search = JSON.parse(sessionStorage.getItem('job_info_data_in_search'))
      //console.log(_this.job_info_data_in_search)
    }, 300)


  }
}
</script>

<style>
.search-div-style {
  position: relative;
  background: #FFFFFF;
}
</style>
